package com.santu.edu.supporter.biz.user.pojo.dto;

import com.santu.edu.supporter.biz.user.pojo.params.UserUpdateParam;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class UserDTO {

    /**
     * 学校id
     */
    private String schoolId;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 推广码
     */
    private String invitationCode;


    /**
     * 用户令牌
     */
    private String token;

    public static UserDTO createItem(String userId) {
        return new UserDTO()
                .setUserId(userId);
    }

    public static UserDTO createItem(UserUpdateParam updateParam) {
        return new UserDTO()
                .setUserId(updateParam.getUserId())
                .setUserName(updateParam.getUserName())
                .setPhone(updateParam.getPhone())
                .setAvatar(updateParam.getAvatar());
    }
}
